跳到主要内容

SetItalic

Sets the italic property to the text characters in the current cell or cell range.

Syntax

expression.SetItalic(isItalic);

expression - A variable that represents a ApiRange class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isItalicRequiredbooleanSpecifies that the contents of the current cell / cell range are displayed italicized.

Returns

This method doesn't return any data.

Example

This example sets the italic property to the text characters in the cell.

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A2").SetValue("Italicized text");
oWorksheet.GetRange("A2").SetItalic(true);
oWorksheet.GetRange("A3").SetValue("Normal text");